package com.aiit.util;


import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LuTao
 * @Date: 2022/03/02/23:24
 */
public class SaltUtil {

    /*
    * 生成salt的静态方法*/
    public static String getSalt(int n){
        char[] chars="ABCDEFGHIGKLMNOPQRSTUVWTSYZabcdefghigklmnopqrstuvwtsyz0123456789!@#$%&*".toCharArray();
        StringBuilder sb=new StringBuilder();
        for (int i=0;i<n;i++){

         char aChar = chars[new Random().nextInt(chars.length)];
         sb.append(aChar);
        }
       return sb.toString();
    }

 /*   public static void main(String[] args) {
        String salt = getSalt(4);
        System.out.println(salt);
    }*/
}
